<?php
/**
 * Created by PhpStorm.
 * User: 68008000
 * Date: 2017/12/4
 * Time: 16:53
 */

namespace app\admin\controller;


use think\Controller;

class lists extends Controller
{
    protected $db;
    public function __construct()
    {
        parent::__construct();
        $this->db = new \app\common\model\Lists();
    }

    //首页
    public function index(){
        $data = db('order')->order('gtime desc')->select();
        //1视图
        return view('',compact('data'));
    }

    //修改状态
    public function add(){
        if(request()->isPost()){
            $data=input('post.');
            $res=$this->db->add($data);
            if ($res['valid']) {
                $this->success($res['msg'], 'index');
            } else {
                $this->error($res['msg']);
            }
        }
    }
}